package com.ebor.utils.exception;

import com.ebor.utils.common.HttpStatus;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 系统运行时异常
 * @author C
 **/
@Getter
@Setter
@ToString
public class SysRuntimeException extends RuntimeException {

    private String code;

    private String message;

    public SysRuntimeException(){
        this.message = HttpStatus.UNKNOWN_EXCEPTION.getRespMsg();
        this.code = HttpStatus.UNKNOWN_EXCEPTION.getRespCode();

    }

    public SysRuntimeException(String code, String message){
        this.code = code;
        this.message = message;
    }

    public SysRuntimeException(HttpStatus httpStatus){
        this.code = httpStatus.getRespCode();
        this.message = httpStatus.getRespMsg();
    }
}
